<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Configuring logging</title>
    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" />
    <link rel="up" href="log.html" title="Chapter 16.  The Logging Subsystem" />
    <link rel="prev" href="log.html" title="Chapter 16.  The Logging Subsystem" />
    <link rel="next" href="log_limits.html" title="Log file limits" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Configuring logging</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="log.html">Prev</a> </td>
          <th width="60%" align="center">Chapter 16. 
		The Logging Subsystem
        </th>
          <td width="20%" align="right"> <a accesskey="n" href="log_limits.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="log_config"></a>Configuring logging</h2>
          </div>
        </div>
      </div>
      <p>The aspects of logging that may be configured are the size of the
logging subsystem's region, the size of the log files on disk and the
size of the log buffer in memory.  The <a href="../api_reference/C/envset_lg_regionmax.html" class="olink">DB_ENV-&gt;set_lg_regionmax()</a> method
specifies the size of the logging subsystem's region, in bytes.  The
logging subsystem's default size is approximately 60KB.  This value may
need to be increased if a large number of files are registered with the
Berkeley DB log manager, for example, by opening a large number of Berkeley DB
database files in a transactional application.</p>
      <p>The <a href="../api_reference/C/envset_lg_max.html" class="olink">DB_ENV-&gt;set_lg_max()</a> method specifies the individual log file size for
all the applications sharing the Berkeley DB environment.  Setting the log
file size is largely a matter of convenience and a reflection of the
application's preferences in backup media and frequency.  However,
setting the log file size too low can potentially cause problems because
it would be possible to run out of log sequence numbers, which requires
a full archival and application restart to reset.  See
<a class="xref" href="log_limits.html" title="Log file limits">Log file limits</a> for more
information.</p>
      <p>The <a href="../api_reference/C/envset_lg_bsize.html" class="olink">DB_ENV-&gt;set_lg_bsize()</a> method specifies the size of the in-memory log
buffer, in bytes.  Log information is stored in memory until the buffer
fills up or transaction commit forces the buffer to be written to disk.
Larger buffer sizes can significantly increase throughput in the
presence of long-running transactions, highly concurrent applications,
or transactions producing large amounts of data.  By default, the buffer
is approximately 32KB.</p>
      <p>The <a href="../api_reference/C/envset_lg_dir.html" class="olink">DB_ENV-&gt;set_lg_dir()</a> method specifies the directory in which
log files will be placed.  By default, log files are placed in
the environment home directory.</p>
      <p>The <a href="../api_reference/C/envset_lg_filemode.html" class="olink">DB_ENV-&gt;set_lg_filemode()</a> method specifies the absolute file mode for
created log files.  This method is only useful for the rare Berkeley DB
application that does not control its umask value.</p>
      <p>The <a href="../api_reference/C/envlog_set_config.html" class="olink">DB_ENV-&gt;log_set_config()</a> method configures several boolean parameters
that control the use of file system controls such as O_DIRECT and O_DSYNC,
automatic removal of log files, in-memory logging, and pre-zeroing of logfiles.</p>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="log.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="log.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="log_limits.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">Chapter 16. 
		The Logging Subsystem
         </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> Log file limits</td>
        </tr>
      </table>
    </div>
  </body>
</html>
